<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="dao.CommDAO"%>
<%@page import="util.Info"%>
<%@page import="util.PageManager"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0028)http://csir461.com/index.jsp -->
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE></TITLE>
<LINK rel=stylesheet type=text/css href="npticketsys_files/css1.css">


<STYLE type=text/css>
.STYLE1 {
	COLOR: #d77745
}
</STYLE>

<LINK rel=stylesheet type=text/css href="npticketsys_files/css1.css">
<STYLE type=text/css>
BODY {
	MARGIN: 0px
}

BODY {
	FONT-FAMILY: 宋体
}

TD {
	FONT-FAMILY: 宋体
}

TH {
	FONT-FAMILY: 宋体
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.19222">
</HEAD>
<% 
new CommDAO().delete(request,"hangban"); 
String id = request.getParameter("id"); 
HashMap mmm = new CommDAO().getmap(id,"hangban"); 
String erjitype = request.getParameter("erjitype"); 
String myztree = request.getParameter("myztree"); 
HashMap ext = new HashMap();
if(request.getParameter("f")!=null)
{
String crnums = request.getParameter("crnums")==null?"0":request.getParameter("crnums"); 
String ernums = request.getParameter("ernums")==null?"0":request.getParameter("ernums"); 
String nums = request.getParameter("nums")==null?"0":request.getParameter("nums"); 
if(crnums.equals(""))crnums="0";
if(ernums.equals(""))ernums="0";
 int pnums =Integer.parseInt(nums)-( Integer.parseInt(crnums)+Integer.parseInt(ernums));
String hbno = request.getParameter("hbno"); 
new CommDAO().commOper("update hangban set nums="+pnums+" where hbno='"+hbno+"'");
} 
ext.put("uname",Info.getUser(request).get("uname"));
ext.put("status","已发送待受理");
new CommDAO().insert(request,response,"orders",ext,true,false); 

%>
<BODY>




	<form action="yd.jsp?f=f&id=<%=mmm.get("id")%>" name="f1" method="post"
		onsubmit="return checkform()">
		<TABLE width="98%" border=0 align="center" cellPadding=0 cellSpacing=0>
			<TBODY>

				<TR>
					<TD>
						<TABLE class=mt border=0 cellSpacing=0 cellPadding=0 width="100%">
							<TBODY>
								<TR>
									<TD align=left vAlign=top>
										<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
											<TBODY>

												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>航班号</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><%=mmm.get("hbno") %><input
														type=text style="display: none" class='textBox' id='hbno'
														name='hbno' size=35 /><label id='clabelhbno' /></TD>
												</TR>
												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>飞行航线</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><%=mmm.get("fxhx") %><input
														type=text style="display: none" class='textBox' id='fxhx'
														name='fxhx' size=35 /><label id='clabelfxhx' /></TD>
												</TR>
												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>起飞时间</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><%=mmm.get("stime") %><input
														type=text class='textBox' style="display: none" id='stime'
														name='stime' size=35 /><label id='clabelstime' /></TD>
												</TR>

												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>头等舱票价</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><%=mmm.get("crprice") %><input
														type=text class='textBox' style="display: none"
														id='crprice' name='crprice' size=35 /><label
														id='clabelcrprice' /></TD>
												</TR>
												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>普通舱票价</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><%=mmm.get("etprice") %><input
														type=text class='textBox' style="display: none"
														id='etprice' name='etprice' size=35 /><label
														id='clabeletprice' /></TD>
												</TR>
												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>折扣</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh>

														<%=mmm.get("discount") %> <%
                                if(Info.getUser(request).get("mlevel").equals("VIP")){
                                 %> &nbsp;&nbsp;&nbsp;&nbsp; VIP折扣 : <%=new CommDAO().select("select * from mixinfo where infotype='VIP折扣'").get(0).get("infob") %>
														<%} %> <input type=text style="display: none"
														class='textBox' id='discount' name='discount' size=35 /><label
														id='clabeldiscount' />
													</TD>
												</TR>


												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>剩票数量</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><span
														id="spannums"><%=mmm.get("nums") %></span><input type=text
														style="display: none" class='textBox' id='nums'
														name='nums' size=35 /><label id='clabelnums' /></TD>
												</TR>

												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>头等舱票数量</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><input
														type=text class='textBox' id='crnums' name='crnums' size=5
														value=1 onkeyup='clearNoNum(this);'
														onblur='clearNoNum(this);' onmouseup='clearNoNum(this);' /><label
														id='clabelcrnums' /></TD>
												</TR>

												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>普通舱票数量</TD>
													<TD width="74%" height=30 align=left vAlign=center class=xh><input
														type=text class='textBox' id='ernums' name='ernums' size=5
														onkeyup='clearNoNum(this);' onblur='clearNoNum(this);'
														onmouseup='clearNoNum(this);' /><label id='clabelernums' /></TD>
												</TR>


												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>姓名(以 , 隔开)</TD>
													<TD width="74%" height=45 align=left vAlign=center class=xh><textarea
															type=text class='textBox' id='names' name='names'
															cols="40" rows="2"
															style="padding-top: 3px; padding-bottom: 3px"></textarea>
													</TD>
												</TR>

												<TR>
													<TD width="26%" height=30 align=center vAlign=center
														class=xh>身份证号(以 , 隔开)</TD>
													<TD width="74%" height=45 align=left vAlign=center class=xh><textarea
															type=text class='textBox' id='sfids' name='sfids'
															cols="40" rows="2"
															style="padding-top: 3px; padding-bottom: 3px"></textarea>
													</TD>
												</TR>


												<TR>
													<TD height=38 colspan="2" align=center vAlign=center
														class=xh><label> <input type="submit"
															name="button" id="button" value="提交信息">
															&nbsp;&nbsp;&nbsp; <input type=button value='返回上页'
															onclick='popclose();' />
													</label></TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
			</TBODY>
		</TABLE>


	</form>


</BODY>
</HTML>
<script language=javascript
	src='/npticketsys/js/My97DatePicker/WdatePicker.js'></script>
<script language=javascript src='/npticketsys/js/ajax.js'></script>
<script language=javascript src='/npticketsys/js/popup.js'></script>
<%@page import="util.Info"%>
<%@page import="util.Info"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="util.PageManager"%>
<%@page import="dao.CommDAO"%>
<script language=javascript>  
 
</script>
<script language=javascript>  
 function checkform(){  
 
var crnumsobj = document.getElementById("crnums");  
if(crnumsobj.value==""){  
document.getElementById("clabelcrnums").innerHTML="&nbsp;&nbsp;<font color=red>请输入数量</font>";  
return false;  
}else{
document.getElementById("clabelcrnums").innerHTML="  ";  
}  

var ernumsvalue = document.getElementById("ernums").value==""?"0":document.getElementById("ernums").value;  
var spannums = document.getElementById("spannums").innerHTML;
 
if((Number(ernumsvalue)+Number(crnumsobj.value))>Number(spannums))
{
document.getElementById("clabelnums").innerHTML="&nbsp;&nbsp;<font color=red>余票不足</font>";  
return false;  
}else{
document.getElementById("clabelnums").innerHTML=" ";
}
 
return true;   
}   
</script>
<%=Info.tform(mmm)%>

<%
if(Info.getUser(request).get("mlevel").equals("VIP")){
double vipdis = Double.parseDouble(new CommDAO().select("select * from mixinfo where infotype='VIP折扣'").get(0).get("infob").toString()) ;
double discount = 10d;
if(!mmm.get("discount").equals(""))
{
 discount = Double.parseDouble( mmm.get("discount").toString()) ;
}
if(vipdis<=discount){
 %>
<script type="text/javascript">
 f1.discount.value='<%=vipdis%>';
</script>
<%}else{ %>
<script type="text/javascript">
 f1.discount.value='<%=discount%>';
</script>
<%}} %>